package com.nxk.modules.core.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Data
@TableName("sys_user")
public class SysUser extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.UUID)
    private String id;


    private String userCode;

    @Length(max = 64,message = "登陆账号不能大于64位")
    @NotEmpty(message = "登陆账号不能为空")
    @TableField(condition = SqlCondition.LIKE)
    private String loginCode;

    @Length(max = 64,message = "密码长度不能大于64位")
    @TableField(select = false)
    private String password;

    @TableField(select = false)
    private String salt;

    @Length(max = 64,message = "用户名不能大于64位")
    @TableField(condition = SqlCondition.LIKE)
    private String userNick;

    @Length(max = 255,message = "用户头像不能大于255位")
    private String userImage;

    @Length(max = 1,message = "用户性别不能大于1位")
    private String userSex;

    @Length(max = 64,message = "手机号不能大于255位")
    @TableField(condition = SqlCondition.LIKE)
    @NotEmpty(message = "手机号不能为空")
    private String userPhone;

    @Length(max = 255,message = "用户邮箱不能大于255位")
    @TableField(condition = SqlCondition.LIKE)
    @NotEmpty(message = "用户邮箱不能为空")
    private String userEmail;

    private String userRole;

     @NotEmpty(message = "用户类型不能为空")
    private String isSystem;

    @Length(max = 1,message = "用户等级不能大于1位")
    @NotEmpty(message = "用户等级不能为空")
    private String userGrade;  //用户等级（1.普通用户 2.普通管理员 3.超级管理员）








}
